package com.zhao.fishingguideserver.exception;

import lombok.Getter;

/**
 * 业务异常类
 * 用于Service层抛出业务逻辑相关的异常
 */
@Getter
public class BusinessException extends RuntimeException {
    
    private final Integer code;
    private final String message;
    
    public BusinessException(String message) {
        super(message);
        this.code = 1; // 默认业务错误码
        this.message = message;
    }
    
    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
    
    public BusinessException(String message, Throwable cause) {
        super(message, cause);
        this.code = 1;
        this.message = message;
    }
}
